public class Factory {
    public Fruit CreateFruit(String kind, Color color) {
        switch(kind) {
            case "A": return new Apple(color);
            case "B": return new Banana(color);
            default: return null;
        }
    }
}